package com.ebt.m.data.entity;
import java.io.Serializable;
import java.util.Date;

import android.text.TextUtils;

import com.ebt.m.utils.DataAnnotationCompareExcept;

public class EntityCustomerAddress extends ACustomerInfoItemContent implements Serializable, Cloneable{
	
	public String uuid;
	
	public Integer addressType;//当等于1时为手机端
	
	public String typeRemark;	//左侧spinner的内容//去掉默认""
	
//	public String countryCode;//去掉默认""
	
	public String province;//去掉默认""
	
	public String city;//去掉默认""
	
	public String district;//去掉默认""
	
	public String details;//去掉默认""
	
	public String zipCode;//去掉默认""
	
	@DataAnnotationCompareExcept
	public Date lastUpdateTime;
	
	@DataAnnotationCompareExcept
	public Integer ChangeStatus;
	
	@DataAnnotationCompareExcept
	public String customerUUId;//去掉默认""
	
	public EntityCustomerAddress() {
	
	}
	
	public EntityCustomerAddress(String uuid, String typeRemark, String province,
			String city, String district, String details, String zipCode) {
		super();
		this.uuid = uuid;
		this.typeRemark = typeRemark;
		this.province = province;
		this.city = city;
		this.district = district;
		this.details = details;
		this.zipCode = zipCode;
	}
	
	public Integer getAddressType() {
		return addressType;
	}

	public void setAddressType(Integer addressType) {
		this.addressType = addressType;
	}

	public Date getLastUpdateTime() {
		return lastUpdateTime;
	}

	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}

	public Integer getChangeStatus() {
		return ChangeStatus;
	}

	public void setChangeStatus(Integer changeStatus) {
		ChangeStatus = changeStatus;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getCustomerUUId() {
		return customerUUId;
	}

	public void setCustomerUUId(String customerUUId) {
		this.customerUUId = customerUUId;
	}
	
	public String getTypeRemark() {
		return typeRemark;
	}

	public void setTypeRemark(String typeRemark) {
		this.typeRemark = typeRemark;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getDistrict() {
		return district;
	}

	public void setDistrict(String district) {
		this.district = district;
	}

	public String getDetails() {
		return details;
	}

	public void setDetails(String details) {
		this.details = details;
	}

	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}
	
	@Override
	public String toString() {
		return "AddressContentItem: uuid is " + uuid + " | typeRemark is " + typeRemark
				+ " | province is " + province + " | city "
				+ city + " | district " + district + " | details is " + details + " | zipCode is " + zipCode;
	}
	
	public String toDetails(){
		StringBuilder sb = new StringBuilder();
		sb.append(parseString(province));
		sb.append(parseString(city));
		sb.append(parseString(district));
		sb.append(parseString(details));
		return sb.toString();
	}

	public String parseString(String s){
		if(TextUtils.isEmpty(s)){
			return "";
		}
		String[] ss = s.split("_");
		return ss[0];
	}
	
	@Override
	public Object clone() throws CloneNotSupportedException {
		return (EntityCustomerAddress) super.clone();
	}
	
}
